In [1]:
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import numpy as np
from IPython.display import display, Math, Latex
import pylab
import plot_methods
import optimization_methods
%matplotlib inline
In [2]:
my_function = lambda x, y: x**2+2*y**2+0.012*x*y-2*y+x

Plot function graphic

In [ ]:
plot_methods.plot_function(my_function, 'My function')

Newton method

In [ ]:
results = optimization_methods.newton_method(my_function, [1,1], 1e-5)

Contour

In [ ]:
plot_methods.plot_contour(my_function, 'Contour')

Contour and Scatter

In [ ]:
plot_methods.plot_contour_and_scatter_of_descent(my_function, results, 
                                                 'Contour and Scatter Newton method')
In [ ]:
 
In [ ]: